
<div id="layout_main_top">

</div>
<div id="layout_main">

{if !isset($errormessage)}


<form action="index.php?page=raids" method="post">
<INPUT TYPE=HIDDEN NAME="action" value="add">
  <table id="small_table" cellspacing='0'>
    <tr class="menu_header">
  	<th colspan='3'>
  	New Raid
  	</th>
  	</tr>

  	<tr class="row_1">
	<td colspan='3' class="staticboldcenter">
	Please insert the following information:<br><span class="error">{$errormessage}</span><br>
	</td>
	</tr>
  	<tr class="row_1">
		<td class="staticboldright">
		<br>
		</td>
		<td class="autonormaltop">
		<br>
		</td>
		<td class="autonormaltopright" width="16px">
		<br>
		</td>
	</tr>
  	<tr class="row_1">
		<td class="staticboldright">
			Location:

			{if isset($event_error)}
				<img src="./images/icon-error.png" width="16px" height="16px" {popup text=$event_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
		<td class="autonormalcenter">
			{html_options options=$events name="event" class="large" selected=$event_id}
		</td>
		<td class="autonormal">
			{if isset($event_error)}
				<img src="./images/icon-error.png" width="16px" height="16px" {popup text=$event_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
			Date:
		</td>
		<td class="autonormalcenter">
			<div style="margin-left: 15px; float: left;"><input type="text" id="datetime" class="text" name="date" value="{$date}"></div>
			<div style="margin-left: 1px; float: left;"><img id="trigger" src="./images/buttons/calendar.png" style="cursor: pointer;" /></img></div>
		</td>
		<td class="autonormal">
			{if isset($date_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$date_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left"{popup text="The freeze time is the number of hours before the raid starts when the raid gets 'frozen'.<br>This means that Main players cannot unsign a couple of hours before raid start.<br>Use this to make sure players will get -RP when not showing up."  center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>Freeze time:
		</td>
		<td class="autonormalcenter">
			<input type="text" id="freeze_time" class="smalltext" name="freeze_time" value="{$freeze_time}"> Hour(s)
		</td>
		<td class="autonormal">
			{if isset($freezetime_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$freeze_time_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		Leader:
		</td>
		<td class="autonormalcenter">
			{html_options options=$players name="leader" class="large" selected=$leader_id}
		</td>
		<td class="autonormal">
			{if isset($leader_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$leader_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		Maintank 1:
		</td>
		<td class="autonormalcenter">
			{html_options options=$warriors name="mt1" class="large" selected=$maintank1_id}
		</td>
		</td>
		<td class="autonormal">
			{if isset($maintank1_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$maintank1_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		Maintank 2:
		</td>
		<td class="autonormalcenter">
			{html_options options=$warriors name="mt2" class="large" selected=$maintank2_id}
		</td>
		<td class="autonormal">
			{if isset($maintank2_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$maintank2_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
			Signup Limit:
		</td>
		<td class="autonormalcenter">
			<input type="text" id="signuplimit" class="smalltext" name="mainlimit" value="{$mainlimit}">
		</td>
		<td class="autonormal">
			{if isset($mainlimit_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$mainlimit_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
			Sub Limit:
		</td>
		<td class="autonormalcenter">
			<input type="text" id="signuplimit" class="smalltext" name="sublimit" value="{$sublimit}">
		</td>
		<td class="autonormal">
			{if isset($sublimit_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$sublimit_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
						<tr class="row_1">
					<td class="staticright">
						
					</td>
					<td class="autonormalcenter" colspan="2">
						<hr>
					</td>
				</tr>
			{foreach name=roles item=role from=$roles}
				<tr class="row_1">
					<td class="staticboldright">
						<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left"{popup text="The number of this main role that are allowed. If a players class role is full, he can only sign up for the Main role's. <br>(ie. if a protection paladin's spots are full, the prot pala can only sign up for the 'General' tank spot.<br>If you dont care about what class role you get only fill in the Main role, empty roles will be ignored!" center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
						{$role.role_name}
					</td>
					<td class="autonormalcenter">
						<input type="text" id="{$role.role_name}" class="smalltext" name="{$role.role_name}" value="0"> <br>
					</td>
					<td class="autonormal">
						
					</td>
				</tr>
				{foreach name=class_roles item=class_role from=$role.class_roles}
				<tr class="row_1">
					<td class="staticright">
						{$class_role.class_role_name}
					</td>
					<td class="autonormalcenter">
						<input type="text" id="{$class_role.class_role_name}" class="smalltext" name="{$class_role.class_role_name}" value="0"> <br>						
					</td>
					<td class="autonormal">
						
					</td>
				</tr>
				{/foreach}
				<tr class="row_1">
					<td class="staticright">
						
					</td>
					<td class="autonormalcenter" colspan="2">
						<hr>
					</td>
				</tr>
			{/foreach}
	<tr class="row_1">
		<td class="staticboldright">
		<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left"{popup text="The minimum Main Team is the team that is allowed to sign up as a main.<br>All teams above this one automaticly gain Main rights as well."  center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>Min. Main Team:
		</td>
		<td class="autonormalcenter">
			{html_options options=$teams name="mainteam" class="large"}
		</td>
		<td class="autonormal">
			{if isset($mainteam_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$mainteam_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		<img src="./images/buttons/icon-hint.png" width="16px" height="16px" align="left" {popup text="The minimum Sub Team is the team that is allowed to sign up as a sub.<br>All teams <b>above</b> this one automaticly gain Sub rights as well.<br>All teams <b>below</b> this team will not be allowed to signup at all!"  center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>Min. Sub Team:
		</td>
		<td class="autonormalcenter">
			{html_options options=$teams name="subteam" class="large"}
		</td>
		<td class="autonormal">
			{if isset($subteam_error)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$subteam_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>

	<tr class="row_1">
		<td class="staticboldright">
		RP Usage:
		</td>
		<td class="autonormalcenter">

		<select name="rp_category_id" class="large">
			{foreach name=categories item=category from=$rp_categories}
				<option value="{$category.category_id}" {if $cur_raid.rp_category_id eq $category.category_id}SELECTED{/if}>{$category.category_long_name} RP</option>
			{/foreach}
		</select>
		</td>
		<td class="autonormal">
			{if isset($rp_category_id)}
				<img src="./images/buttons/icon-error.png" width="16px" height="16px" {popup text=$subteam_error   center=#overlib_center# wrap=true offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}></img>
			{/if}
		</td>
	</tr>

	<tr class="row_1">
		<td class="staticboldright" valign="top">
		Description:
		</td>
		<td class="autonormalcenter" rowspan="3">
		<textarea rows="2" cols="20" name="comment">{$comment}</textarea>
		</td>
		<td class="autonormal">
		&nbsp;
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		</td>
		<td class="autonormal">
		&nbsp;
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldright">
		</td>
		<td class="autonormal">
		&nbsp;
		</td>
	</tr>
  	<tr class="row_1">
		<td class="staticboldright">
		<br>
		</td>
		<td class="autonormalbottom">
		<br>
		</td>
		<td class="autonormalbottomright">
		&nbsp;
		</td>
	</tr>
	<tr class="row_1">
		<td class="staticboldcenter" colspan="3">
		<br>
		<input name="newraid" type="submit" value="Add raid">
		</td>
	</tr>

 </table>
</form>

{dhtml_calendar inputField="datetime" button="trigger" singleClick=false showsTime=true timeFormat="24" ifFormat="%Y-%m-%d - %H:%M"}

{else}



<DIV class="MenuHead">
Succesfull!
</DIV>

<DIV class="MenuText">
{$message}
</DIV>




{/if}
</div>
<div id="layout_main_bottom">

</div>